import os
import sys
from ttkbootstrap import Style

from gui import AutoClickerGUI

def main():
    """
    主程序入口函数
    """
    style = Style(theme="superhero")
    root = style.master
    root.geometry("550x800")

    # 设置图标(可选)
    if getattr(sys, 'frozen', False):
        icon_path = os.path.join(sys._MEIPASS, 'diamond_sword.ico')
    else:
        icon_path = 'diamond_sword.ico'
    try:
        root.iconbitmap(icon_path)
    except:
        pass

    app = AutoClickerGUI(root)
    root.protocol("WM_DELETE_WINDOW", app.on_close)
    root.mainloop()


if __name__ == "__main__":
    main()
